﻿using System;

namespace StaticVarApplication
{
    class StaticVar
    {
        public static int num;

        public void Count()
        {
            num++;
        }

        public static int GetNum()
        {
            return num;
        }
    }
    class StaticTester
    {
        static void Main(string[] args)
        {
            StaticVar s = new StaticVar();
            s.Count();
            s.Count();
            s.Count();
            Console.WriteLine("变量 num：{0}", StaticVar.GetNum());
            Console.ReadKey();
        }
    }
}